﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KuPeiXun.Dao.Action.EF
{
    #region 实体间的转换
    /// <summary>
    /// 实体间的转换
    /// </summary>
    /// ===============================================================
    /// 作者：邹学良 
    /// 时间：2013-03-21
    /// 描述：创建
    /// 历史：无
    /// ===============================================================
    public class Convert
    {
        #region 1、Country
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-21
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.Country ToEntity(KuPeiXun.Dao.Action.EF.DataSource.Country ef)
        {
            try
            {
                KuPeiXun.Entity.Country entity = new Entity.Country();
                entity.English = ef.English;
                entity.ID = ef.ID;
                entity.Name = ef.Name;
                entity.PinYin = ef.PinYin;
                entity.CreateDate = ef.CreateDate;
                entity.IsDelete = KuPeiXun.Entity.Convert.ToIsDelete(ef.IsDelete.Value);
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId.Value;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="entity">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-21
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.Country ToEF(KuPeiXun.Entity.Country entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.Country ef = new DataSource.Country();
                ef.ManagerId = entity.ManagerId;
                ef.Name = entity.Name;
                ef.CreateDate = entity.CreateDate;
                ef.English = entity.English;
                ef.ID = entity.ID;
                ef.IsDelete = KuPeiXun.Entity.Convert.ToBoolean(entity.IsDelete);
                ef.Manager = entity.Manager;
                ef.PinYin = entity.PinYin;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 2、Province
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.Province ToEntity(KuPeiXun.Dao.Action.EF.DataSource.Province ef)
        {
            try
            {
                KuPeiXun.Entity.Province entity = new Entity.Province();
                entity.English = ef.English;
                entity.ID = ef.ID;
                entity.Name = ef.Name;
                entity.PinYin = ef.PinYin;
                entity.CreateDate = ef.CreateDate;
                entity.IsDelete = KuPeiXun.Entity.Convert.ToIsDelete(ef.IsDelete.Value);
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId.Value;
                entity.CountryId = ef.CountryId;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="entity">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.Province ToEF(KuPeiXun.Entity.Province entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.Province ef = new DataSource.Province();
                ef.ManagerId = entity.ManagerId;
                ef.Name = entity.Name;
                ef.CreateDate = entity.CreateDate;
                ef.English = entity.English;
                ef.ID = entity.ID;
                ef.IsDelete = KuPeiXun.Entity.Convert.ToBoolean(entity.IsDelete);
                ef.Manager = entity.Manager;
                ef.PinYin = entity.PinYin;
                ef.CountryId = entity.CountryId;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 3、City
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.City ToEntity(KuPeiXun.Dao.Action.EF.DataSource.City ef)
        {
            try
            {
                KuPeiXun.Entity.City entity = new Entity.City();
                entity.English = ef.English;
                entity.ID = ef.ID;
                entity.Name = ef.Name;
                entity.PinYin = ef.PinYin;
                entity.CreateDate = ef.CreateDate;
                entity.IsDelete = KuPeiXun.Entity.Convert.ToIsDelete(ef.IsDelete.Value);
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId.Value;
                entity.ProvinceId = ef.ProvinceId;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="entity">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.City ToEF(KuPeiXun.Entity.City entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.City ef = new DataSource.City();
                ef.ManagerId = entity.ManagerId;
                ef.Name = entity.Name;
                ef.CreateDate = entity.CreateDate;
                ef.English = entity.English;
                ef.ID = entity.ID;
                ef.IsDelete = KuPeiXun.Entity.Convert.ToBoolean(entity.IsDelete);
                ef.Manager = entity.Manager;
                ef.PinYin = entity.PinYin;
                ef.ProvinceId = entity.ProvinceId;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 4、Area
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.Area ToEntity(KuPeiXun.Dao.Action.EF.DataSource.Area ef)
        {
            try
            {
                KuPeiXun.Entity.Area entity = new Entity.Area();
                entity.English = ef.English;
                entity.ID = ef.ID;
                entity.Name = ef.Name;
                entity.PinYin = ef.PinYin;
                entity.CreateDate = ef.CreateDate;
                entity.IsDelete = KuPeiXun.Entity.Convert.ToIsDelete(ef.IsDelete.Value);
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId.Value;
                entity.CityId = ef.CityId;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="entity">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.Area ToEF(KuPeiXun.Entity.Area entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.Area ef = new DataSource.Area();
                ef.ManagerId = entity.ManagerId;
                ef.Name = entity.Name;
                ef.CreateDate = entity.CreateDate;
                ef.English = entity.English;
                ef.ID = entity.ID;
                ef.IsDelete = KuPeiXun.Entity.Convert.ToBoolean(entity.IsDelete);
                ef.Manager = entity.Manager;
                ef.PinYin = entity.PinYin;
                ef.CityId = entity.CityId;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 5、TOAccount
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TOAccount ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TOAccount ef)
        {
            try
            {
                KuPeiXun.Entity.TOAccount entity = new Entity.TOAccount();
                entity.Active = KuPeiXun.Entity.Convert.ToIsActive(ef.Active.Value);
                entity.Email = ef.Email;
                entity.ID = ef.ID;
                entity.Password = ef.Password;
                entity.RegistDate = ef.RegistDate;
                entity.RegistIP = ef.RegistIP;
                entity.State = KuPeiXun.Entity.Convert.ToTOState(ef.State.Value);
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="entity">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TOAccount ToEF(KuPeiXun.Entity.TOAccount entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TOAccount ef = new DataSource.TOAccount();
                ef.Active = KuPeiXun.Entity.Convert.ToBoolean(entity.Active);
                ef.Email = entity.Email;
                ef.ID = entity.ID;
                ef.Password = entity.Password;
                ef.RegistDate = entity.RegistDate;
                ef.RegistIP = entity.RegistIP;
                ef.State = KuPeiXun.Entity.Convert.ToInt32(entity.State);
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 6、TOBaseInfo
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TOBaseInfo ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TOBaseInfo ef)
        {
            try
            {
                KuPeiXun.Entity.TOBaseInfo entity = new Entity.TOBaseInfo();
                entity.AccountId = ef.AccountId;
                entity.Address = ef.Address;
                entity.Area = ef.Area;
                entity.AreaId = ef.AreaId;
                entity.City = ef.City;
                entity.CityId = ef.CityId;
                entity.Country = ef.Country;
                entity.CountryId = ef.CountryId;
                entity.CreateDate = ef.CreateDate;
                entity.Email = ef.Email;
                entity.English = ef.English;
                entity.FoundDate = ef.FoundDate;
                entity.ID = ef.ID;
                entity.LinkPerson = ef.LinkPerson;
                entity.Logo = ef.Logo;
                entity.Name = ef.Name;
                entity.OfficialWebSite = ef.OfficialWebSite;
                entity.Phone = ef.Phone;
                entity.PinYin = ef.PinYin;
                entity.Province = ef.Province;
                entity.ProvinceId = ef.ProvinceId;
                entity.Tags = ef.Tags;
                entity.TeacherMax = ef.TeacherMax;
                entity.TeacherMin = ef.TeacherMin;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TOBaseInfo ToEF(KuPeiXun.Entity.TOBaseInfo entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TOBaseInfo ef = new DataSource.TOBaseInfo();
                ef.AccountId = entity.AccountId;
                ef.Address = entity.Address;
                ef.Area = entity.Area;
                ef.AreaId = entity.AreaId;
                ef.City = entity.City;
                ef.CityId = entity.CityId;
                ef.Country = entity.Country;
                ef.CountryId = entity.CountryId;
                ef.CreateDate = entity.CreateDate;
                ef.Email = entity.Email;
                ef.English = entity.English;
                ef.FoundDate = entity.FoundDate;
                ef.ID = entity.ID;
                ef.LinkPerson = entity.LinkPerson;
                ef.Logo = entity.Logo;
                ef.Name = entity.Name;
                ef.OfficialWebSite = entity.OfficialWebSite;
                ef.Phone = entity.Phone;
                ef.PinYin = entity.PinYin;
                ef.Province = entity.Province;
                ef.ProvinceId = entity.ProvinceId;
                ef.Tags = entity.Tags;
                ef.TeacherMax = entity.TeacherMax;
                ef.TeacherMin = entity.TeacherMin;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 7、TOCertificate
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TOCertificate ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TOCertificate ef)
        {
            try
            {
                KuPeiXun.Entity.TOCertificate entity = new Entity.TOCertificate();
                entity.AccountId = ef.AccountId;
                entity.CreateDate = ef.CreateDate;
                entity.Description = ef.Description;
                entity.ID = ef.ID;
                entity.ImageNavigationUrl = ef.ImageNavigationUrl;
                entity.Title = ef.Title;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TOCertificate ToEF(KuPeiXun.Entity.TOCertificate entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TOCertificate ef = new DataSource.TOCertificate();
                ef.AccountId = entity.AccountId;
                ef.CreateDate = entity.CreateDate;
                ef.Description = entity.Title;
                ef.ID = entity.ID;
                ef.ImageNavigationUrl = entity.ImageNavigationUrl;
                ef.Title = entity.Title;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 8、TOContactUs
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TOContactUs ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TOContactUs ef)
        {
            try
            {
                KuPeiXun.Entity.TOContactUs entity = new Entity.TOContactUs();
                entity.AccountId = ef.AccountId;
                entity.CreateDate = ef.CreateDate;
                entity.Address = ef.Address;
                entity.Email = ef.Email;
                entity.Fax = ef.Fax;
                entity.MobilePhone = ef.MobilePhone;
                entity.ID = ef.ID;
                entity.Name = ef.Name;
                entity.OfficialWebSite = ef.OfficialWebSite;
                entity.Person = ef.Person;
                entity.Phone = ef.Phone;
                entity.Zip = ef.Zip;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TOContactUs ToEF(KuPeiXun.Entity.TOContactUs entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TOContactUs ef = new DataSource.TOContactUs();
                ef.AccountId = entity.AccountId;
                ef.Address = entity.Address;
                ef.CreateDate = entity.CreateDate;
                ef.Email = entity.Email;
                ef.Fax = entity.Fax;
                ef.ID = entity.ID;
                ef.MobilePhone = entity.MobilePhone;
                ef.Name = entity.Name;
                ef.OfficialWebSite = entity.OfficialWebSite;
                ef.Person = entity.Person;
                ef.Phone = entity.Phone;
                ef.Zip = entity.Zip;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 9、TOCourse
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TOCourse ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TOCourse ef)
        {
            try
            {
                KuPeiXun.Entity.TOCourse entity = new Entity.TOCourse();
                entity.AccountId = ef.AccountId;
                entity.Content = ef.Content;
                entity.CreateDate = ef.CreateDate;
                entity.Duration = ef.Duration;
                entity.ID = ef.ID;
                entity.ImageNavigationUrl = ef.ImageNavigationUrl;
                entity.Name = ef.Name;
                entity.Price = ef.Price;
                entity.Tags = ef.Tags;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TOCourse ToEF(KuPeiXun.Entity.TOCourse entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TOCourse ef = new DataSource.TOCourse();
                ef.AccountId = entity.AccountId;
                ef.Content = entity.Content;
                ef.CreateDate = entity.CreateDate;
                ef.Duration = entity.Duration;
                ef.ID = entity.ID;
                ef.ImageNavigationUrl = entity.ImageNavigationUrl;
                ef.Name = entity.Name;
                ef.Price = entity.Price;
                ef.Tags = entity.Tags;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 10、TOImage
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TOImage ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TOImage ef)
        {
            try
            {
                KuPeiXun.Entity.TOImage entity = new Entity.TOImage();
                entity.AccountId = ef.AccountId;
                entity.CreateDate = ef.CreateDate;
                entity.Description = ef.Description;
                entity.ID = ef.ID;
                entity.ImageNavigationUrl = ef.ImageNavigationUrl;
                entity.Title = ef.Title;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TOImage ToEF(KuPeiXun.Entity.TOImage entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TOImage ef = new DataSource.TOImage();
                ef.AccountId = entity.AccountId;
                ef.CreateDate = entity.CreateDate;
                ef.Description = entity.Description;
                ef.ID = entity.ID;
                ef.ImageNavigationUrl = entity.ImageNavigationUrl;
                ef.Title = entity.Title;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 11、TOIntro
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TOIntro ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TOIntro ef)
        {
            try
            {
                KuPeiXun.Entity.TOIntro entity = new Entity.TOIntro();
                entity.AccountId = ef.AccountId;
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.Intro = ef.Intro;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TOIntro ToEF(KuPeiXun.Entity.TOIntro entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TOIntro ef = new DataSource.TOIntro();
                ef.AccountId = entity.AccountId;
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.Intro = entity.Intro;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 12、TOLearningPhase
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TOLearningPhase ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TOLearningPhase ef)
        {
            try
            {
                KuPeiXun.Entity.TOLearningPhase entity = new Entity.TOLearningPhase();
                entity.Content = ef.Content;
                entity.CourseId = ef.CourseId;
                entity.CreateDate = ef.CreateDate;
                entity.Duration = ef.Duration;
                entity.ID = ef.ID;
                entity.Name = ef.Name;
                entity.OrderIndex = ef.OrderIndex;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TOLearningPhase ToEF(KuPeiXun.Entity.TOLearningPhase entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TOLearningPhase ef = new DataSource.TOLearningPhase();
                ef.Content = entity.Content;
                ef.CourseId = entity.CourseId;
                ef.CreateDate = entity.CreateDate;
                ef.Duration = entity.Duration;
                ef.ID = entity.ID;
                ef.Name = entity.Name;
                ef.OrderIndex = entity.OrderIndex;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 13、TORecommend
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TORecommend ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TORecommend ef)
        {
            try
            {
                KuPeiXun.Entity.TORecommend entity = new Entity.TORecommend();
                entity.AccountId = ef.AccountId;
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                entity.OrderIndex = ef.OrderIndex;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TORecommend ToEF(KuPeiXun.Entity.TORecommend entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TORecommend ef = new DataSource.TORecommend();
                ef.AccountId = entity.AccountId;
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.Manager = entity.Manager;
                ef.ManagerId = entity.ManagerId;
                ef.OrderIndex = entity.OrderIndex;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 14、TORegistCode
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TORegistCode ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TORegistCode ef)
        {
            try
            {
                KuPeiXun.Entity.TORegistCode entity = new Entity.TORegistCode();
                entity.AccountId = ef.AccountId;
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.Code = ef.Code;
                entity.Expires = ef.Expires;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TORegistCode ToEF(KuPeiXun.Entity.TORegistCode entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TORegistCode ef = new DataSource.TORegistCode();
                ef.AccountId = entity.AccountId;
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.Code = entity.Code;
                ef.Expires = entity.Expires;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 15、TOStudent
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TOStudent ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TOStudent ef)
        {
            try
            {
                KuPeiXun.Entity.TOStudent entity = new Entity.TOStudent();
                entity.AccountId = ef.AccountId;
                entity.Age = ef.Age;
                entity.CreateDate = ef.CreateDate;
                entity.Description = ef.Description;
                entity.ID = ef.ID;
                entity.Name = ef.Name;
                entity.Photo = ef.Photo;
                entity.Salary = ef.Salary;
                entity.StudyDate = ef.StudyDate;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TOStudent ToEF(KuPeiXun.Entity.TOStudent entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TOStudent ef = new DataSource.TOStudent();
                ef.AccountId = entity.AccountId;
                ef.Age = entity.Age;
                ef.CreateDate = entity.CreateDate;
                ef.Description = entity.Description;
                ef.ID = entity.ID;
                ef.Name = entity.Name;
                ef.Photo = entity.Photo;
                ef.Salary = entity.Salary;
                ef.StudyDate = entity.StudyDate;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 16、TOTeacher
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TOTeacher ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TOTeacher ef)
        {
            try
            {
                KuPeiXun.Entity.TOTeacher entity = new Entity.TOTeacher();
                entity.AccountId = ef.AccountId;
                entity.CreateDate = ef.CreateDate;
                entity.English = ef.English;
                entity.ID = ef.ID;
                entity.Intro = ef.Intro;
                entity.Name = ef.Name;
                entity.Photo = ef.Photo;
                entity.PinYin = ef.PinYin;
                entity.Technology = ef.Technology;
                entity.Title = ef.Title;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TOTeacher ToEF(KuPeiXun.Entity.TOTeacher entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TOTeacher ef = new DataSource.TOTeacher();
                ef.AccountId = entity.AccountId;
                ef.CreateDate = entity.CreateDate;
                ef.English = entity.English;
                ef.ID = entity.ID;
                ef.Intro = entity.Intro;
                ef.Name = entity.Name;
                ef.Photo = entity.Photo;
                ef.PinYin = entity.PinYin;
                ef.Technology = entity.Technology;
                ef.Title = entity.Title;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 17、TOTeacherIntro
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TOTeacherIntro ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TOTeacherIntro ef)
        {
            try
            {
                KuPeiXun.Entity.TOTeacherIntro entity = new Entity.TOTeacherIntro();
                entity.AccountId = ef.AccountId;
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.Intro = ef.Intro;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TOTeacherIntro ToEF(KuPeiXun.Entity.TOTeacherIntro entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TOTeacherIntro ef = new DataSource.TOTeacherIntro();
                ef.AccountId = entity.AccountId;
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.Intro = entity.Intro;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 18、TrainExperience
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.TrainExperience ToEntity(KuPeiXun.Dao.Action.EF.DataSource.TrainExperience ef)
        {
            try
            {
                KuPeiXun.Entity.TrainExperience entity = new Entity.TrainExperience();
                entity.AccountId = ef.AccountId;
                entity.Area = ef.Area;
                entity.AreaId = ef.AreaId;
                entity.City = ef.City;
                entity.CityId = ef.CityId;
                entity.Country = ef.Country;
                entity.CountryId = ef.CountryId;
                entity.CreateDate = ef.CreateDate;
                entity.Duration = ef.Duration;
                entity.ID = ef.ID;
                entity.Province = ef.Province;
                entity.ProvinceId = ef.ProvinceId;
                entity.Result = ef.Result;
                entity.Skill = ef.Skill;
                entity.TOName = ef.TOName;
                entity.TrainDate = ef.TrainDate;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.TrainExperience ToEF(KuPeiXun.Entity.TrainExperience entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.TrainExperience ef = new DataSource.TrainExperience();
                ef.AccountId = entity.AccountId;
                ef.Area = entity.Area;
                ef.AreaId = entity.AreaId;
                ef.City = entity.City;
                ef.CityId = entity.CityId;
                ef.Country = entity.Country;
                ef.CountryId = entity.CountryId;
                ef.CreateDate = entity.CreateDate;
                ef.Duration = entity.Duration;
                ef.ID = entity.ID;
                ef.Province = entity.Province;
                ef.ProvinceId = entity.ProvinceId;
                ef.Result = entity.Result;
                ef.Skill = entity.Skill;
                ef.TOName = entity.TOName;
                ef.TrainDate = entity.TrainDate;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 19、User
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.User ToEntity(KuPeiXun.Dao.Action.EF.DataSource.User ef)
        {
            try
            {
                KuPeiXun.Entity.User entity = new Entity.User();
                entity.Active = KuPeiXun.Entity.Convert.ToIsActive(ef.Active.Value);
                entity.ID = ef.ID;
                entity.Email = ef.Email;
                entity.Name = ef.Name;
                entity.Password = ef.Password;
                entity.RegistDate = ef.RegistDate;
                entity.RegistIP = ef.RegistIP;
                entity.State = KuPeiXun.Entity.Convert.ToUserState(ef.State.Value);
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.User ToEF(KuPeiXun.Entity.User entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.User ef = new DataSource.User();
                ef.Active = KuPeiXun.Entity.Convert.ToBoolean(entity.Active);
                ef.Email = entity.Email;
                ef.ID = entity.ID;
                ef.Name = entity.Name;
                ef.Password = entity.Password;
                ef.RegistDate = entity.RegistDate;
                ef.RegistIP = entity.RegistIP;
                ef.State = KuPeiXun.Entity.Convert.ToInt32(entity.State);
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 20、UserInfo
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.UserInfo ToEntity(KuPeiXun.Dao.Action.EF.DataSource.UserInfo ef)
        {
            try
            {
                KuPeiXun.Entity.UserInfo entity = new Entity.UserInfo();
                entity.AccountId = ef.AccountId;
                entity.Age = ef.Age;
                entity.Area = ef.Area;
                entity.AreaId = ef.AreaId;
                entity.Birthday = ef.Birthday;
                entity.City = ef.City;
                entity.CityId = ef.CityId;
                entity.Country = ef.Country;
                entity.CountryId = ef.CountryId;
                entity.CreateDate = ef.CreateDate;
                entity.Gender = KuPeiXun.Entity.Convert.ToGender(ef.Gender.Value);
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.UserInfo ToEF(KuPeiXun.Entity.UserInfo entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.UserInfo ef = new DataSource.UserInfo();
                ef.AccountId = entity.AccountId;
                ef.Age = entity.Age;
                ef.Area = entity.Area;
                ef.AreaId = entity.AreaId;
                ef.Birthday = entity.Birthday;
                ef.City = entity.City;
                ef.CityId = entity.CityId;
                ef.Country = entity.Country;
                ef.CountryId = entity.CountryId;
                ef.CreateDate = entity.CreateDate;
                ef.Gender = KuPeiXun.Entity.Convert.ToInt32(entity.Gender);
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 21、ViewedTO
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.ViewedTO ToEntity(KuPeiXun.Dao.Action.EF.DataSource.ViewedTO ef)
        {
            try
            {
                KuPeiXun.Entity.ViewedTO entity = new Entity.ViewedTO();
                entity.AccountId = ef.AccountId;
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.TOId = ef.TOId;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.ViewedTO ToEF(KuPeiXun.Entity.ViewedTO entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.ViewedTO ef = new DataSource.ViewedTO();
                ef.AccountId = entity.AccountId;
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.TOId = entity.TOId;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 22、WebLog
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.WebLog ToEntity(KuPeiXun.Dao.Action.EF.DataSource.WebLog ef)
        {
            try
            {
                KuPeiXun.Entity.WebLog entity = new Entity.WebLog();
                entity.ID = ef.ID;
                entity.NavigationUrl = ef.NavigationUrl;
                entity.RequestDate = ef.RequestDate;
                entity.RequestIP = ef.RequestIP;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.WebLog ToEF(KuPeiXun.Entity.WebLog entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.WebLog ef = new DataSource.WebLog();
                ef.ID = entity.ID;
                ef.NavigationUrl = entity.NavigationUrl;
                ef.RequestDate = entity.RequestDate;
                ef.RequestIP = entity.RequestIP;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 23、Ask
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.Ask ToEntity(KuPeiXun.Dao.Action.EF.DataSource.Ask ef)
        {
            try
            {
                KuPeiXun.Entity.Ask entity = new Entity.Ask();
                entity.AccountId = ef.AccountId;
                entity.Answer = ef.Answer;
                entity.AnswerDate = ef.AnswerDate;
                entity.Content = ef.Content;
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                entity.Title = ef.Title;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.Ask ToEF(KuPeiXun.Entity.Ask entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.Ask ef = new DataSource.Ask();
                ef.AccountId = entity.AccountId;
                ef.Answer = entity.Answer;
                ef.AnswerDate = entity.AnswerDate;
                ef.Content = entity.Content;
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.Manager = entity.Manager;
                ef.ManagerId = entity.ManagerId;
                ef.Title = entity.Title;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 24、CoupleBack
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.CoupleBack ToEntity(KuPeiXun.Dao.Action.EF.DataSource.CoupleBack ef)
        {
            try
            {
                KuPeiXun.Entity.CoupleBack entity = new Entity.CoupleBack();
                entity.Answer = ef.Answer;
                entity.AnswerDate = ef.AnswerDate;
                entity.Content = ef.Content;
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                entity.Title = ef.Title;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.CoupleBack ToEF(KuPeiXun.Entity.CoupleBack entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.CoupleBack ef = new DataSource.CoupleBack();
                ef.Answer = entity.Answer;
                ef.AnswerDate = entity.AnswerDate;
                ef.Content = entity.Content;
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.Manager = entity.Manager;
                ef.ManagerId = entity.ManagerId;
                ef.Title = entity.Title;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 25、CourseRecommend
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.CourseRecommend ToEntity(KuPeiXun.Dao.Action.EF.DataSource.CourseRecommend ef)
        {
            try
            {
                KuPeiXun.Entity.CourseRecommend entity = new Entity.CourseRecommend();
                entity.CourseId = ef.CourseId;
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                entity.OrderIndex = ef.OrderIndex;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.CourseRecommend ToEF(KuPeiXun.Entity.CourseRecommend entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.CourseRecommend ef = new DataSource.CourseRecommend();
                ef.CourseId = entity.CourseId;
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.Manager = entity.Manager;
                ef.ManagerId = entity.ManagerId;
                ef.OrderIndex = entity.OrderIndex;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 26、Evaluating
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.Evaluating ToEntity(KuPeiXun.Dao.Action.EF.DataSource.Evaluating ef)
        {
            try
            {
                KuPeiXun.Entity.Evaluating entity = new Entity.Evaluating();
                entity.Comment = ef.Comment;
                entity.CommentDate = ef.CommentDate;
                entity.Environment = ef.Environment;
                entity.ID = ef.ID;
                entity.Recommendation = KuPeiXun.Entity.Convert.ToRecommendation(ef.Recommendation.Value);
                entity.TeacherTeam = ef.TeacherTeam;
                entity.TeachQuality = ef.TeachQuality;
                entity.TOAccountId = ef.TOAccountId;
                entity.Total = ef.Total;
                entity.UserIP = ef.UserIP;
                entity.UserName = ef.UserName;
                entity.Worked = ef.Worked;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.Evaluating ToEF(KuPeiXun.Entity.Evaluating entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.Evaluating ef = new DataSource.Evaluating();
                ef.Comment = entity.Comment;
                ef.CommentDate = entity.CommentDate;
                ef.Environment = entity.Environment;
                ef.ID = entity.ID;
                ef.Recommendation = KuPeiXun.Entity.Convert.ToBoolean(entity.Recommendation);
                ef.TeacherTeam = entity.TeacherTeam;
                ef.TeachQuality = entity.TeachQuality;
                ef.TOAccountId = entity.TOAccountId;
                ef.Total = entity.Total;
                ef.UserIP = entity.UserIP;
                ef.UserName = entity.UserName;
                ef.Worked = entity.Worked; ;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 27、FriendLink
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.FriendLink ToEntity(KuPeiXun.Dao.Action.EF.DataSource.FriendLink ef)
        {
            try
            {
                KuPeiXun.Entity.FriendLink entity = new Entity.FriendLink();
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.ImageNavigationUrl = ef.ImageNavigationUrl;
                entity.IsShow = KuPeiXun.Entity.Convert.ToIsShow(ef.IsShow.Value);
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                entity.Name = ef.Name;
                entity.NavigationUrl = ef.NavigationUrl;
                entity.OrderIndex = ef.OrderIndex;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.FriendLink ToEF(KuPeiXun.Entity.FriendLink entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.FriendLink ef = new DataSource.FriendLink();
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.ImageNavigationUrl = entity.ImageNavigationUrl;
                ef.IsShow = KuPeiXun.Entity.Convert.ToBoolean(entity.IsShow);
                ef.Manager = entity.Manager;
                ef.ManagerId = entity.ManagerId;
                ef.Name = entity.Name;
                ef.NavigationUrl = entity.NavigationUrl;
                ef.OrderIndex = entity.OrderIndex;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 28、AdMain
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.AdMain ToEntity(KuPeiXun.Dao.Action.EF.DataSource.AdMain ef)
        {
            try
            {
                KuPeiXun.Entity.AdMain entity = new Entity.AdMain();
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.ImageNavigationUrl = ef.ImageNavigationUrl;
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                entity.Navigationurl = ef.Navigationurl;
                entity.OrderIndex = ef.OrderIndex;
                entity.Title = ef.Title;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.AdMain ToEF(KuPeiXun.Entity.AdMain entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.AdMain ef = new DataSource.AdMain();
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.ImageNavigationUrl = entity.ImageNavigationUrl;
                ef.Manager = entity.Manager;
                ef.ManagerId = entity.ManagerId;
                ef.Navigationurl = entity.Navigationurl;
                ef.OrderIndex = entity.OrderIndex;
                ef.Title = entity.Title;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 29、ImageSize
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.ImageSize ToEntity(KuPeiXun.Dao.Action.EF.DataSource.ImageSize ef)
        {
            try
            {
                KuPeiXun.Entity.ImageSize entity = new Entity.ImageSize();
                entity.CreateDate = ef.CreateDate;
                entity.Description = ef.Description;
                entity.Height = ef.Height;
                entity.ID = ef.ID;
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                entity.Name = ef.Name;
                entity.Width = ef.Width;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.ImageSize ToEF(KuPeiXun.Entity.ImageSize entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.ImageSize ef = new DataSource.ImageSize();
                ef.Width = entity.Width;
                ef.Name = entity.Name;
                ef.ManagerId = entity.ManagerId;
                ef.Manager = entity.Manager;
                ef.ID = entity.ID;
                ef.Height = entity.Height;
                ef.Description = entity.Description;
                ef.CreateDate = entity.CreateDate;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 30、Job
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.Job ToEntity(KuPeiXun.Dao.Action.EF.DataSource.Job ef)
        {
            try
            {
                KuPeiXun.Entity.Job entity = new Entity.Job();
                entity.Address = ef.Address;
                entity.City = ef.City;
                entity.CityId = ef.CityId;
                entity.Company = ef.Company;
                entity.CompanyDescription = ef.CompanyDescription;
                entity.Country = ef.Country;
                entity.CountryId = ef.CountryId;
                entity.CreateDate = ef.CreateDate;
                entity.Email = ef.Email;
                entity.ID = ef.ID;
                entity.JobDescription = ef.JobDescription;
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                entity.OfficialWebSite = ef.OfficialWebSite;
                entity.Phone = ef.Phone;
                entity.Position = ef.Position;
                entity.Province = ef.Province;
                entity.ProvinceId = ef.ProvinceId;
                entity.PublishDate = ef.PublishDate;
                entity.SkillRequirement = ef.SkillRequirement;
                entity.Title = ef.Title;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.Job ToEF(KuPeiXun.Entity.Job entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.Job ef = new DataSource.Job();
                ef.Address = entity.Address;
                ef.City = entity.City;
                ef.CityId = entity.CityId;
                ef.Company = entity.Company;
                ef.CompanyDescription = entity.CompanyDescription;
                ef.Country = entity.Country;
                ef.CountryId = entity.CountryId;
                ef.CreateDate = entity.CreateDate;
                ef.Email = entity.Email;
                ef.ID = entity.ID;
                ef.JobDescription = entity.JobDescription;
                ef.Manager = entity.Manager;
                ef.ManagerId = entity.ManagerId;
                ef.OfficialWebSite = entity.OfficialWebSite;
                ef.Phone = entity.Phone;
                ef.Position = entity.Position;
                ef.Province = entity.Province;
                ef.ProvinceId = entity.ProvinceId;
                ef.PublishDate = entity.PublishDate;
                ef.SkillRequirement = entity.SkillRequirement;
                ef.Title = entity.Title;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 31、JobRecommend
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.JobRecommend ToEntity(KuPeiXun.Dao.Action.EF.DataSource.JobRecommend ef)
        {
            try
            {
                KuPeiXun.Entity.JobRecommend entity = new Entity.JobRecommend();
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.JobId = ef.JobId;
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                entity.OrderIndex = ef.OrderIndex;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.JobRecommend ToEF(KuPeiXun.Entity.JobRecommend entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.JobRecommend ef = new DataSource.JobRecommend();
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.JobId = entity.JobId;
                ef.Manager = entity.Manager;
                ef.ManagerId = entity.ManagerId;
                ef.OrderIndex = entity.OrderIndex;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 32、LearnPurpose
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.LearnPurpose ToEntity(KuPeiXun.Dao.Action.EF.DataSource.LearnPurpose ef)
        {
            try
            {
                KuPeiXun.Entity.LearnPurpose entity = new Entity.LearnPurpose();
                entity.AccountId = ef.AccountId;
                entity.Area = ef.Area;
                entity.AreaId = ef.AreaId;
                entity.City = ef.City;
                entity.CityId = ef.CityId;
                entity.Country = ef.Country;
                entity.CountryId = ef.CountryId;
                entity.CreateDate = ef.CreateDate;
                entity.Duration = ef.Duration;
                entity.ID = ef.ID;
                entity.MaxPrice = ef.MaxPrice;
                entity.MinPrice = ef.MinPrice;
                entity.Province = ef.Province;
                entity.ProvinceId = ef.ProvinceId;
                entity.Skill = ef.Skill;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.LearnPurpose ToEF(KuPeiXun.Entity.LearnPurpose entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.LearnPurpose ef = new DataSource.LearnPurpose();
                ef.AccountId = entity.AccountId;
                ef.Area = entity.Area;
                ef.AreaId = entity.AreaId;
                ef.City = entity.City;
                ef.CityId = entity.CityId;
                ef.Country = entity.Country;
                ef.CountryId = entity.CountryId;
                ef.CreateDate = entity.CreateDate;
                ef.Duration = entity.Duration;
                ef.ID = entity.ID;
                ef.MaxPrice = entity.MaxPrice;
                ef.MinPrice = entity.MinPrice;
                ef.Province = entity.Province;
                ef.ProvinceId = entity.ProvinceId;
                ef.Skill = entity.Skill;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 33、Manager
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.Manager ToEntity(KuPeiXun.Dao.Action.EF.DataSource.Manager ef)
        {
            try
            {
                KuPeiXun.Entity.Manager entity = new Entity.Manager();
                entity.CreateDate = ef.CreateDate;
                entity.Code = ef.Code;
                entity.ID = ef.ID;
                entity.IsDelete = KuPeiXun.Entity.Convert.ToIsDelete(ef.IsDelete.Value);
                entity.ManagerId = ef.ManagerId;
                entity.ManagerName = ef.Manager1;
                entity.Name = ef.Name;
                entity.Password = ef.Password;
                entity.RoleId = ef.RoleId;
                entity.State = KuPeiXun.Entity.Convert.ToManagerState(ef.State.Value);
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.Manager ToEF(KuPeiXun.Entity.Manager entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.Manager ef = new DataSource.Manager();
                ef.CreateDate = entity.CreateDate;
                ef.Code = entity.Code;
                ef.ID = entity.ID;
                ef.IsDelete = KuPeiXun.Entity.Convert.ToBoolean(entity.IsDelete);
                ef.ManagerId = entity.ManagerId;
                ef.Manager1 = entity.ManagerName;
                ef.Name = entity.Name;
                ef.Password = entity.Password;
                ef.RoleId = entity.RoleId;
                ef.State = KuPeiXun.Entity.Convert.ToInt32(entity.State);
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 34、ManagerLog
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.ManagerLog ToEntity(KuPeiXun.Dao.Action.EF.DataSource.ManagerLog ef)
        {
            try
            {
                KuPeiXun.Entity.ManagerLog entity = new Entity.ManagerLog();
                entity.ID = ef.ID;
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                entity.NavigationUrl = ef.NavigationUrl;
                entity.Operation = ef.Operation;
                entity.OperationType = KuPeiXun.Entity.Convert.ToOperationType(ef.OperationType.Value);
                entity.RequestDate = ef.RequestDate;
                entity.RequestIP = ef.RequestIP;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.ManagerLog ToEF(KuPeiXun.Entity.ManagerLog entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.ManagerLog ef = new DataSource.ManagerLog();
                ef.ID = entity.ID;
                ef.Manager = entity.Manager;
                ef.ManagerId = entity.ManagerId;
                ef.NavigationUrl = entity.NavigationUrl;
                ef.Operation = entity.Operation;
                ef.OperationType = KuPeiXun.Entity.Convert.ToInt32(entity.OperationType);
                ef.RequestDate = entity.RequestDate;
                ef.RequestIP = entity.RequestIP;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 35、Menu
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.Menu ToEntity(KuPeiXun.Dao.Action.EF.DataSource.Menu ef)
        {
            try
            {
                KuPeiXun.Entity.Menu entity = new Entity.Menu();
                entity.Description = ef.Description;
                entity.ID = ef.ID;
                entity.Name = ef.Name;
                entity.NavigationUrl = ef.NavigationUrl;
                entity.OrderIndex = ef.OrderIndex;
                entity.ParentId = ef.ParentId;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.Menu ToEF(KuPeiXun.Entity.Menu entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.Menu ef = new DataSource.Menu();
                ef.Description = entity.Description;
                ef.ID = entity.ID;
                ef.Name = entity.Name;
                ef.NavigationUrl = entity.NavigationUrl;
                ef.OrderIndex = entity.OrderIndex;
                ef.ParentId = entity.ParentId;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 36、News
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.News ToEntity(KuPeiXun.Dao.Action.EF.DataSource.News ef)
        {
            try
            {
                KuPeiXun.Entity.News entity = new Entity.News();
                entity.Author = ef.Author;
                entity.Content = ef.Content;
                entity.CreateDate = ef.CreateDate;
                entity.FromUrl = ef.FromUrl;
                entity.ID = ef.ID;
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                entity.PublishDate = ef.PublishDate;
                entity.ReadCount = ef.ReadCount;
                entity.Tags = ef.Tags;
                entity.Title = ef.Title;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.News ToEF(KuPeiXun.Entity.News entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.News ef = new DataSource.News();
                ef.Author = entity.Author;
                ef.Content = entity.Content;
                ef.CreateDate = entity.CreateDate;
                ef.FromUrl = entity.FromUrl;
                ef.ID = entity.ID;
                ef.Manager = entity.Manager;
                ef.ManagerId = entity.ManagerId;
                ef.PublishDate = entity.PublishDate;
                ef.ReadCount = entity.ReadCount;
                ef.Tags = entity.Tags;
                ef.Title = entity.Title;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 37、NewsRecommend
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.NewsRecommend ToEntity(KuPeiXun.Dao.Action.EF.DataSource.NewsRecommend ef)
        {
            try
            {
                KuPeiXun.Entity.NewsRecommend entity = new Entity.NewsRecommend();
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                entity.NewsId = ef.NewsId;
                entity.OrderIndex = ef.OrderIndex;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.NewsRecommend ToEF(KuPeiXun.Entity.NewsRecommend entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.NewsRecommend ef = new DataSource.NewsRecommend();
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.Manager = entity.Manager;
                ef.ManagerId = entity.ManagerId;
                ef.NewsId = entity.NewsId;
                ef.OrderIndex = entity.OrderIndex;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 38、Role
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.Role ToEntity(KuPeiXun.Dao.Action.EF.DataSource.Role ef)
        {
            try
            {
                KuPeiXun.Entity.Role entity = new Entity.Role();
                entity.CreateDate = ef.CreateDate;
                entity.Description = ef.Description;
                entity.ID = ef.ID;
                entity.IsDelete = KuPeiXun.Entity.Convert.ToIsDelete(ef.IsDelete.Value);
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                entity.Name = ef.Name;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.Role ToEF(KuPeiXun.Entity.Role entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.Role ef = new DataSource.Role();
                ef.CreateDate = entity.CreateDate;
                ef.Description = entity.Description;
                ef.ID = entity.ID;
                ef.IsDelete = KuPeiXun.Entity.Convert.ToBoolean(entity.IsDelete);
                ef.Manager = entity.Manager;
                ef.ManagerId = entity.ManagerId;
                ef.Name = entity.Name;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 39、RoleMenu
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.RoleMenu ToEntity(KuPeiXun.Dao.Action.EF.DataSource.RoleMenu ef)
        {
            try
            {
                KuPeiXun.Entity.RoleMenu entity = new Entity.RoleMenu();
                entity.ID = ef.ID;
                entity.MenuId = ef.MenuId;
                entity.RoleId = ef.RoleId;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.RoleMenu ToEF(KuPeiXun.Entity.RoleMenu entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.RoleMenu ef = new DataSource.RoleMenu();
                ef.ID = entity.ID;
                ef.RoleId = entity.RoleId;
                ef.MenuId = entity.MenuId;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 40、SkillKeyWord
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.SkillKeyWord ToEntity(KuPeiXun.Dao.Action.EF.DataSource.SkillKeyWord ef)
        {
            try
            {
                KuPeiXun.Entity.SkillKeyWord entity = new Entity.SkillKeyWord();
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.KeyWord = ef.KeyWord;
                entity.Manager = ef.Manager;
                entity.ManagerId = ef.ManagerId;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.SkillKeyWord ToEF(KuPeiXun.Entity.SkillKeyWord entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.SkillKeyWord ef = new DataSource.SkillKeyWord();
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.KeyWord = entity.KeyWord;
                ef.Manager = entity.Manager;
                ef.ManagerId = entity.ManagerId;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion

        #region 41、ThinkOfTO
        /// <summary>
        /// 将EF实体转换为自定义实体
        /// </summary>
        /// <param name="ef">ef实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Entity.ThinkOfTO ToEntity(KuPeiXun.Dao.Action.EF.DataSource.ThinkOfTO ef)
        {
            try
            {
                KuPeiXun.Entity.ThinkOfTO entity = new Entity.ThinkOfTO();
                entity.AccountId = ef.AccountId;
                entity.CreateDate = ef.CreateDate;
                entity.ID = ef.ID;
                entity.TOId = ef.TOId;
                return entity;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }

        /// <summary>
        /// 将自定义实体转换为EF实体
        /// </summary>
        /// <param name="ef">自定义实体</param>
        /// <returns></returns>
        /// ===============================================================
        /// 作者：邹学良 
        /// 时间：2013-03-23
        /// 描述：创建
        /// 历史：无
        /// ===============================================================
        public static KuPeiXun.Dao.Action.EF.DataSource.ThinkOfTO ToEF(KuPeiXun.Entity.ThinkOfTO entity)
        {
            try
            {
                KuPeiXun.Dao.Action.EF.DataSource.ThinkOfTO ef = new DataSource.ThinkOfTO();
                ef.AccountId = entity.AccountId;
                ef.CreateDate = entity.CreateDate;
                ef.ID = entity.ID;
                ef.TOId = entity.TOId;
                return ef;
            }
            catch (Exception ex)
            {
                throw new KuPeiXun.Utility.LogHepler(ex);
            }
        }
        #endregion
    }
    #endregion
}
